package prjtgl.bdd.comptes.profil_utilisateur.poste;

import java.util.List;
import org.hibernate.Query;
import prjtgl.bdd.HGeneral;
import prjtgl.metier.comptes.profil_utilisateur.poste.Direction;


/**
 * Helper BDD pour la table Direction
 * @author Amirouche
 */
public class HDirection extends HGeneral{
	
	public List<Direction> rechercherParDescription(String description){
		session.beginTransaction();
		Query q = session.createQuery("from Direction as u where u.description='" + description + "'");
		List<Direction> directions = q.list();
		return directions;
	}
	
	public List<Direction> listerDirectionsRessemblantes(String description){
		session.beginTransaction();
		Query q = session.createQuery("from Direction as u where u.description like '%" + description + "%'");
		List<Direction> directions = q.list();
		return directions;
	}
	
}
